The disclosure relates to the field of middleware and, more particularly, to programmatically determining an execution mode for a request dispatch utilizing historic metrics.
When an application server processes executable code, such as a Web application (e.g., JAVA Servlet or a JAVA SERVER PAGE), there can be one or more request dispatches present within the Web application. These request dispatches are typically denoted by an include( ) function call specifying a resource to execute, such as another servlet or JAVA SERVER PAGE (JSP). The specified resource can be executed in one of two modes, asynchronously or synchronously. Synchronous execution often results in the executable code blocking (e.g., suspended) until the specified resource execution is complete, a situation which in many instances is unfavorable. Further, the resource can include additional request dispatches, which can execute other resources resulting in an execution chain that frequently introduces significant latency to the Web application. As such, several disadvantages can arise as a result of this latency, which can include unresponsive applications and/or excessive server load.
One solution to overcome these disadvantages is utilizing an asynchronous execution mode for the specified resource. However, asynchronous execution introduces overhead, such as establishing a new thread, placing markers in the output, and replacing markers for server or client side aggregation. In many instances, this overhead can compound latency which can significantly reduce performance gains offered by asynchronous execution. For instance, synchronous execution of a resource can result in 10 ms latency, where executing the same resource asynchronously can result in 20 ms latency due to the overhead introduced by the asynchronous execution (e.g., thread setup costs).
Further, in dynamic server environments, synchronous and asynchronous resource execution can have varying results due to changes in resource availability. Since Web applications are commonly deployed in these environments, the Web applications are subject to fluctuating performances. To address these problems, Web developers often make educated guesses about which execution mode can yield the best performance results. Often times, these guesses do not result in the most optimal application performance. As such, many server environments executing Web applications can suffer from inefficient resource usage and reduced server capability which can unduly burden an information technology (IT) infrastructure.